package com.ysx.crm;


import com.ysx.crm.bean.CatBean;
import com.ysx.crm.bean.UserBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;


/**
 * 含有@Configuration注解的类=配置类
 * 配置类=applicationContext.xml的作用
 */
@Configuration

//设置扫描路径
@ComponentScan(basePackages = {"com.ysx.crm.bean"})
public class JavaConfiguration {

    /**
     * <bean name="getCat" class="com.ysx.crm.bean.CatBean"></bean>
     */
    @Bean
    public CatBean getCat(){
        return new CatBean();
    }

    /**
     * <bean name="userBean" class="com.ysx.crm.bean.UserBean"></bean>
     */
    @Bean(name="userBean")
    public UserBean getUserBean(){
        return new UserBean();
    }
}
